﻿package learnmath.windows{
/*-------------------------------------------------------------
	Created by: Ionel Alexandru 
	Mail: ionel.alexandru@gmail.com
	Site: www.learn-math.info
---------------------------------------------------------------*/
import learnmath.windows.util.*;
import learnmath.windows.elements.*;
import flash.display.*;
import flash.text.*;


public class ConfigManager{

	public static var applications:Array = new Array();
	
	public static function init(xmlConfig:XML):void{
		var appsXML = xmlConfig.children()[1];
		for(var i=0; i<appsXML.children().length(); i++){
			var app = appsXML.children()[i];
			var appBean:AppBean = new AppBean();
			appBean.name = appsXML.children()[i].name;
			appBean.id = appsXML.children()[i].id;
			appBean.appTypeId = appsXML.children()[i].appTypeId;
			appBean.iconLittle = appsXML.children()[i].iconlittle;
			appBean.iconBig = appsXML.children()[i].iconbig;
			appBean.movieclip = appsXML.children()[i].movieclip;
			applications[applications.length] = appBean;
			var displayTaskBar = appsXML.children()[i].attribute("displayInTaskbar")
			if(displayTaskBar=="false"){ appBean.displayTaskbar = false;}
			var singleton = appsXML.children()[i].attribute("singleton")
			if(singleton=="true"){ appBean.singleton = true;}
		}
		
	}
	
	
	public static function getTextFormatForButtons():TextFormat{
		var tf:TextFormat = new TextFormat();
		tf.font = "Tahoma";
		tf.bold = true;
		tf.size = 11;		
		return tf;
	}
	public static function getTextFormatForTitle():TextFormat{
		var tf:TextFormat = new TextFormat();
		tf.font = "Tahoma";
		tf.color = 0xffffff;
		tf.bold = true;
		tf.size = 11;		
		return tf;
	}
	public static function getTextFormatForStatus():TextFormat{
		var tf:TextFormat = new TextFormat();
		tf.font = "Tahoma";
		tf.color = 0x000000;
		tf.size = 10;		
		return tf;
	}
	public static function getTextFormatIcon():TextFormat{
		var tf:TextFormat = new TextFormat();
		tf.font = "Tahoma";
		tf.color = 0x000000;
		tf.align = "center";
		tf.size = 10;		
		return tf;
	}

	public static function getTextFormatForStatus2():TextFormat{
		var tf:TextFormat = new TextFormat();
		tf.font = "Tahoma";
		tf.color = 0x00009C;
		tf.bold = true;
		tf.size = 10;		
		return tf;
	}
	
	public static function getTextFormatForMenu():TextFormat{
		var tf:TextFormat = new TextFormat();
		tf.font = "Tahoma";
		tf.color = 0x000000;
		tf.size = 11;		
		return tf;
	}

	public static function getTextFormatForMenuOver():TextFormat{
		var tf:TextFormat = getTextFormatForMenu();
		tf.color = 0xffffff;
		return tf;
	}
}
}